﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<ContactManager.Models.Entities.Contact>" %>
<%@ Import Namespace="ContactManager.Helpers" %>
<%= Html.ValidationSummary("Please correct the errors and try again.") %>

 <% using (Html.BeginForm()) {%>
        <%= Html.ValidationSummary(true) %>

        <fieldset>
            <legend>Fields</legend>
            <!--div class="editor-label">
                <%= Html.LabelFor(model => model.Id) %>
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.Id) %>
                <%= Html.ValidationMessageFor(model => model.Id) %>
            </div-->
         
            
            <div class="editor-field">
               <%= Html.HiddenFor(model => model.Id) %>
                <%= Html.ConditionalTextBoxFor(model => model.DateEntered).MakeReadOnlyIf(() => Model.DateEntered.ToString().Length > 0) %>
             
                
            </div>
            <div class="editor-label">
                <%= Html.LabelFor(model => model.GroupId)%>
            </div>
            <div class="editor-field">
               
                <%= Html.ConditionalTextBoxFor(model => model.GroupId).MakeReadOnlyIf(() => Model.GroupId.ToString().Length > 0) %>
             
                
            </div>
            <div class="editor-label">
                <%= Html.LabelFor(model => model.ContactGroup)%>
            </div>
            <div class="editor-field">
                <%= Html.ConditionalTextBoxFor(model => model.ContactGroup.Name).MakeReadOnlyIf(() => Model.ContactGroup.Name.Length > 0)%>
                
             
                
            </div>
                     
            
            <div class="editor-label">
                <%= Html.LabelFor(model => model.FirstName)%>
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.FirstName)%>
                <%= Html.ValidationMessageFor(model => model.FirstName)%>
            </div>
            
            <div class="editor-label">
                <%= Html.LabelFor(model => model.LastName)%>
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.LastName)%>
                <%= Html.ValidationMessageFor(model => model.LastName)%>
            </div>
            
            <div class="editor-label">
                <%= Html.LabelFor(model => model.Phone)%>
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.Phone)%>
                <%= Html.ValidationMessageFor(model => model.Phone)%>
            </div>
            
            <div class="editor-label">
                <%= Html.LabelFor(model => model.Email)%>
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.Email)%>
                <%= Html.ValidationMessageFor(model => model.Email)%>
            </div>
            <div class="editor-label">
                <%= Html.LabelFor(model => model.Age) %>
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.Age) %>
                <%= Html.ValidationMessageFor(model => model.Age) %>
                
            </div>
            <p>
                <input type="submit" value="Edit" />
            </p>
         
        </fieldset>

    <% } %>